﻿using System;
using System.Collections;
using AcademicPlanner.Data.Entities;
using NHibernate.Tool.hbm2ddl;
using NHibernate;


namespace AcademicPlanner.Data.Repositories
{
    public class ACObjectTokenEntityRepository
    {
		/*private ACObjectTokenEntityRepository() 
		{
			namedQueriesPrefix = "ACObjectTokenEntity";
		}

		private class InstanceHolder 
		{
			internal static ACObjectTokenEntityRepository INSTANCE = new ACObjectTokenEntityRepository(); 
		}


		public static ACObjectTokenEntityRepository GetInstance()
		{ 
			return InstanceHolder.INSTANCE; 
		}


		public ACObjectTokenEntity GetNew()
		{
			var rEnt = new ACObjectTokenEntity();
			rEnt.SetDefaults();
			return rEnt;
		}

		/*public new PersonEntity FindById(int pId)
		{
			PersonEntity rEnt = (PersonEntity)base.FindById(pId);
			return rEnt;
		}*/

		/*public ACObjectTokenEntity FindByObjectAndPurpose(string pObject, string pPurpose)
		{
			ACObjectTokenEntity rEnt = null;
			IQuery vQuery = GetQuery("by.object.and.purpose");
			IList vEnts;

			try
			{
				vQuery.SetString("object", pObject);
				vQuery.SetString("purpose", pPurpose);
				vQuery.SetInt16("expired", 1);
				vQuery.SetMaxResults(1);
				vEnts = vQuery.List();
			}
			catch (HibernateException vHx)
			{
				var vDx = new DataException(DataErrorCode
						.QUERY_ACOBJECT_TOKEN_ENTITY_BY_OBJECT_AND_PURPOSE_FAILED, vHx);
				throw vDx;
			}

			if (vEnts.Count > 0)
				rEnt = (ACObjectTokenEntity)vEnts[0];

			return rEnt;
		}*/
    }
}
